<!-- BEGIN RIGHT SIDEBAR -->            
<div class="col-lg-2">
    <div class="blog-side-item">
        <div class="category">
        	<h3>搜索</h3>
        	<#include "side_search_bar.ftl">
            <h3>分类</h3>
            <@shishuocms_folder_list fatherId="${firstFolder.folderId}">
            <ul class="list-unstyled">
            	<#list tag_folder_list as secondLevelFolder>
                    <li><a href="${basePath}/${firstFolder.type}/${firstFolder.ename}/${secondLevelFolder.ename}/index.htm">
                    	<i class="icon-angle-right"></i> ${secondLevelFolder.name}</a>
                    	<div id="list_page_folder_${secondLevelFolder.folderId}"><div>
                    	<script>
                    	<#if secondLevelFolder.folderId==18>
						$(function(){
							 var p=$('#p').val();
							 var baseUrl="${basePath}/${secondLevelFolder.type}/${firstFolder.ename}/${secondLevelFolder.ename}/";
							 $.post("${basePath}/left_tool_bar.json",{'folderId':${secondLevelFolder.folderId},'p':p},function(data){
									if(data.result){
										var showData="";
										if((null!=data.tag_folder_list_next)&&0<data.tag_folder_list_next.length)
										{
											for(var i=0;i<data.tag_folder_list_next.length;i++){
												showData+='<li><a href="${basePath}/${secondLevelFolder.type}/${firstFolder.ename}/${secondLevelFolder.ename}/'+data.tag_folder_list_next[i].ename+'/index.htm">';
									        	showData+='&nbsp;<i class="icon-angle-right"></i>'+data.tag_folder_list_next[i].name+'</a>';
									        	showData+='</li>';
											}
										}
										$("#list_page_folder_${secondLevelFolder.folderId}").html(showData);
									}
							},"json");
						});
						function pageIndex(baseUrl,folderId,pageIndex){
							var maxPage=parseInt($("#maxPage").val());
							var currentPage=parseInt($("#currentPage").val());
							if(pageIndex==-1&&currentPage>=2){
								var showData='';
								showData+='<li ';
								if(currentPage==1){
									showData+='class="disabled"';
								}
								showData+=' onClick="pageIndex(-1);"><span>&laquo;</span></li>';
								showData+='	<li class="disabled"><span>共'+maxPage+'页('+(currentPage-1)+')</span></li>';
								showData+='<li onClick="pageIndex(1);"><span>&raquo;</span></li>';
								$("#page_ul").html(showData);
								showStock(baseUrl,folderId,currentPage-1);
								$("#currentPage").val(currentPage-1);
							}else if(pageIndex==1&&currentPage<maxPage){
								//下一页
								currentPage=currentPage+1;
								var showData='';
								showData+='<li  onClick="pageIndex(-1);"><span>&laquo;</span></li>';
								showData+='	<li class="disabled"><span>共'+maxPage+'页('+currentPage+')</span></li>';
								showData+='<li ';
								if(currentPage>=maxPage){
									showData+='class="disabled"';
								}
								showData+=' onClick="pageIndex(1);"><span>&raquo;</span></li>';
								$("#page_ul").html(showData);
								showStock(baseUrl,folderId,currentPage);
								$("#currentPage").val(currentPage);
							}
						}
						function showStock(baseUrl,folderId,pageNum){
							$.post("${basePath}/left_tool_bar.json",{'folderId':folderId,'p':pageNum},function(data){
								if(data.result){
										var showData="";
										if((null!=data.tag_folder_list_next)&&0<data.tag_folder_list_next.length)
										{
											for(var i=0;i<data.tag_folder_list_next.length;i++){
												showData+='<li><a href="'+baseUrl+data.tag_folder_list_next[i].ename+'/index.htm">';
									        	showData+='&nbsp;<i class="icon-angle-right"></i>'+data.tag_folder_list_next[i].name+'</a>';
									        	showData+='</li>';
											}
										}
										var item="#list_page_folder_"+folderId+"";
										$(item).html(showData);
									}
							},"json");
						}
						</#if>
						</script>
					</li>
                 </#list>
            </ul>
            </@shishuocms_folder_list>
        </div>
    </div>
</div>
<!-- END RIGHT SIDEBAR --> 
